package com.mrper.model.type;

/**
 * Created by admin on 2016/3/11.
 * 1:九块商品 2:十九块 3:二十九块 5:四十九
 */
public enum Double9Type {

    NEW(0),
    Double9(1),
    TenDouble9(2),
    TwentyDouble9(3),
    FourtyDouble9(5);

    private int value = 0;

    Double9Type(int value){
        this.value = value;
    }

    public int getValue(){
        return value;
    }

    public static Double9Type valueOf(int value) throws Exception {
        switch(value){
            case 0:
                return NEW;
            case 1:
                return Double9;
            case 2:
                return TenDouble9;
            case 3:
                return TwentyDouble9;
            case 5:
                return FourtyDouble9;
        }
        throw new Exception("Unknown Type");
    }

}
